﻿using DocumentFormat.OpenXml.Wordprocessing;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using OfficeOpenXml.Table;
using Org.BouncyCastle.Crypto;
using System;
using System.Collections.Generic;
using System.Text;

namespace NP.BPMReportPlatform.Reports.ThirdFlow.Dtos
{
    [ExcelExporter(Name = "三方流程审批报表", TableStyle = TableStyles.Light10, AutoFitAllColumn = true)]
    public class GetThirdFlowCommonOutput
    {
        /// <summary>
        /// 流程编号
        /// </summary>
        [ExporterHeader(DisplayName = "流程编号")]
        public string InstanceNumber { get; set; }

        /// <summary>
        /// 单据详情链接
        /// </summary>
        [IEIgnore(IsExportIgnore = true)]
        public string Url { get; set; }

        /// <summary>
        /// 流程主题
        /// </summary>
        [ExporterHeader(DisplayName = "流程主题")]
        public string Topic { get; set; }

        /// <summary>
        /// 发起人
        /// </summary>
        [ExporterHeader(DisplayName = "申请人")]
        public string StartUserName { get; set; }

        /// <summary>
        /// 制单日期
        /// </summary>
        [ExporterHeader(DisplayName = "制单日期")]
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 当前步骤
        /// </summary>
        [ExporterHeader(DisplayName = "当前步骤")]
        public string LatestActivityName { get; set; }

        /// <summary>
        /// 审批人
        /// </summary>
        [ExporterHeader(DisplayName = "审批人")]
        public string ActivityResolverName { get; set; }

        /// <summary>
        /// 状态编码
        /// </summary>
        [IEIgnore(IsExportIgnore = true)]
        public int Status { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [ExporterHeader(DisplayName = "状态")]
        public string StatusName { get; set; }

        [ExporterHeader(IsIgnore = true)]
        public int InstanceId { get; set; }

        [ExporterHeader(IsIgnore = true)]
        public Guid ActivityId { get; set; }

        [ExporterHeader(IsIgnore = true)]
        public List<string> UserNames { get; set; }
    }

    public class ThirdFlowResult
    {
        public int Code { get; set; }

        public string Message { get; set; }
    }

    public class ThirdFlowCallBackDto
    {
        /// <summary>
        /// ESB接口地址
        /// </summary>
        public string ESBUrl { get; set; }

        /// <summary>
        /// ESB服务名
        /// </summary>
        public string ServiceName { get; set; }

        /// <summary>
        /// 回调策略
        /// 1：审批步骤回调
        /// 2：审批步骤同意前回调（根据返回结果决定是否允许审批通过）
        /// 3：审批完成回调
        /// 4：审批结束前回调（类似2，但是是最后一级才会回调，判断是否最后一级的逻辑目前在前端表单，后端逻辑暂没有做限制）
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// SAP接口名（只有SAP的回调接口才需要）
        /// </summary>
        public string SAPINTERFACENAME { get; set; }
    }
}
